package com.cy.pj.common.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author YuBaoFu
 * @create 2025/05/28
 * @description
 */
@Data
@NoArgsConstructor
public class JsonResult {

    private Integer state = 1; /*响应状态码 1成功 0失败*/
    private String message = "ok"; /*响应消息 默认成功ok*/
    private Object data;    /*成功后携带的消息*/

    public JsonResult(String message){
        this.message = message;
    }

    public JsonResult(Object data){
        this.data = data;
    }

    public JsonResult(Throwable t){
        this.state = 0;
        this.message = t.getMessage();
    }

}
